package org.amphiprion.descentv2assistant.entity.comparator;

import java.util.Comparator;

import org.amphiprion.descentv2assistant.entity.EncounterQuest;

public class EncounterQuestActComparator implements Comparator<EncounterQuest> {

	@Override
	public int compare(EncounterQuest lhs, EncounterQuest rhs) {
		if (lhs.getAct() == rhs.getAct()) {
			if (lhs.getCreationDate() < rhs.getCreationDate()) {
				return -1;
			} else if (lhs.getCreationDate() > rhs.getCreationDate()) {
				return 1;
			} else {
				return 0;
			}
		} else {
			return lhs.getAct() - rhs.getAct();
		}
	}

}
